#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <stdio.h>
#include <stdlib.h>

long long sumScores(char* s)
{
    int len = strlen(s);
    int i = 1;
    int j = 0;
    int score = 0;

    for (i = 1; i <= len; i++)
    {
        for (j = 0; j < i; j++)
        {
            if (s[j] == s[len - i + j])
            {
                score++;
            }
            else
            {
                break;
            }
        }
    }

    return score;
}

int main()
{
    int len = 54463;
    char* s = (char*)calloc(len, sizeof(char));

    if (s == NULL)
    {
        exit(1);
    }

    for (int i = 0; i < len; i++)
    {
        s[i] = 'p';
    }

    //long long len = sizeof(s) / sizeof(s[0]);
    long long score = sumScores(s);

    //printf("%lld\n", len);
    printf("%lld\n", score);

    return 0;
}